<template>

  <result-info :icon="icon"
               :label="label"
               :right-count="rightCount"
               :score="score"
               :wrong-count="wrongCount"
  />

</template>
<script>
  import ResultInfo from './ResultInfo'

  export default {
    name: 'ExamResultInfo',
    components: {ResultInfo},
    props: ['result', 'rightCnt'],
    computed: {
      icon() {
        return this.isPassed ? '/web-hft-ee/static/img/m/pass_test.png' : '/web-hft-ee/static/img/m/nopass_test.png'
      },
      label() {
        return this.isPassed ? '通过考试' : '未通过考试'
      },
      isPassed() {
        return this.score >= this.result.passScore
      },
      score() {
        return this.result.score || 0
      },
      rightCount() {
        return this.rightCnt;
      },
      wrongCount() {
        return this.result["totalCnt"] - this.rightCount;
      },
    },
  }
</script>
